0

join with conditions

i want a formula where i join a table to a text file, this i allready got working, but i want a condition where in the table i line is called "eis" i want a text with all the line with "eis" and a seperate text with where it isnt "eis"

 

if 'prijs' = "eis" then
    var a := join(for p in range(0, cnt('prijs'.aantal)) do
            item('prijs'.aantal, p) + " x " +
            item('prijs'.omschrijving, p) +
            " " +
            item('prijs'.'totaal.calc', p)
        end, ", ");
    void
else
    var b := join(for p in range(0, cnt('prijs'.aantal)) do
            item('prijs'.aantal, p) + " x " +
            item('prijs'.omschrijving, p) +
            " " +
            item('prijs'.'totaal.calc', p)
        end, ", ");
    void
end 

10 replies

null
    • Alex_Fransen
    • 2 mths ago
    • Reported - view

    i tried with var and with let but doesnt seems to work

    • Ninox partner
    • RoSoft_Steven.1
    • 2 mths ago
    • Reported - view

    Can you provide the full code so we can get more information about what you want to achieve?

    • Alex_Fransen
    • 2 mths ago
    • Reported - view

    let a1 := "Verzekeringseis: ";
    let a3 := "prijzen zijn excl. BTW";
    a1 +
    join(for p in range(0, cnt('prijsopgaaf offerte mail'.aantal)) do
        item('prijsopgaaf offerte mail'.aantal, p) + " x " +
        item('prijsopgaaf offerte mail'.omschrijving, p) +
        " " +
        item('prijsopgaaf offerte mail'.'totaal.calc', p)
    end, ", ") +
    a3

     

    this is the fullcode wich is working, but in my table i have for each item an extra selection a or b, and i want a string like i have but i want a string for all articles with a and a seperate string for all articles where selection is b

      • Alex_Fransen
      • 2 mths ago
      • Reported - view

       ik gives me now verzekeringseis: 1 x bike €500, 2x motor €600, prijzen zijn excl. BTW

      and i want this for articles where eis is A and and extra string where articles is B  like below

       

      advies : 1x helm €700,- , 6x steer €900, prijzen zijn excl. BTW

       

      then i want them together like this

       

      verzekeringseis: 1 x bike €500, 2x motor €600, prijzen zijn excl. BTW

      advies : 1x helm €700,- , 6x steer €900, prijzen zijn excl. BTW

    • Alex_Fransen
    • 2 mths ago
    • Reported - view

    in the second line articles is B i ment eis is B

      • Ninox partner
      • RoSoft_Steven.1
      • 2 mths ago
      • Reported - view

       

      Als ik het goed begrepen heb is "eis" een keuzeveld (choice field) met twee opties A en B ?

      In het ene geval moet er de tekst "verzekeringseis" voorafgaan en in het andere geval "advies".

      Ben ik juist?

      • Alex_Fransen
      • 2 mths ago
      • Reported - view

      ja met daarachter de bijbehorende join artikelen

      • Ninox partner
      • RoSoft_Steven.1
      • 2 mths ago
      • Reported - view

      Iets in deze aard?

      let ei := "Verzekeringseis: ";
      let ad := "Advies: ";
      join(for p in range(0,cnt('prijsopgaaf offerte mail'.aantal)) do
        if item(text('prijsopgaaf offerte mail'.eis),p) = "A" then ei else ad end +
          item('prijsopgaaf offerte mail'.aantal, p) + " x " +
          item('prijsopgaaf offerte mail'.omschrijving, p) +
          " " +
          item('prijsopgaaf offerte mail'.'totaal.calc', p) + "prijzen zijn excl. BTW"
      end, ", ")

      Zomaar uit de losse pols, er kunnen eventueel nog leestekens ontbreken.

    • Alex_Fransen
    • 2 mths ago
    • Reported - view

    dank je voor de opzet geeft veel duidelijkheid, echter werkt de regel if item ...... = "A" niet , heb alles geprobeerd maar blijft alles van B weergeven ook al staat er een A

      • Ninox partner
      • RoSoft_Steven.1
      • 2 mths ago
      • Reported - view

       Heb je een cloud abonnement? Dan kunt u mij eventueel eens uitnodigen bij uw team - dan bekijk ik het even -  ik heb zelf ook een pro abonnement zodoende verliest u geen gebruiker. Of kan je hier eventueel een dummy database posten zonder gevoelige data? Dit is ook goed. Mijn website bevat de email voor de uitnodiging.

Content aside

  • 2 mths agoLast active
  • 10Replies
  • 46Views
  • 2 Following