Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a problem with the following skript:
if ($(Menu) = 1,
sum (Stunden where Reiszeit = 'Nein'), // only Stunden with "Nein"
sum (Stunden)) as Stunden_Projekt // all Stunden
I would like to controll the two different sums per variable.
The problem is that I don't get the right skript for this.
Thank you for helping
HI
PFA
Regards,
R.Mayil Vahanan
try this
if ($(Menu) = 1 or Reiszeit = 'Nein',Stunden,Stunden) as Stunden_Projekt
Thank you for your answer!
And what about the sum?
sum(if ($(Menu) = 1 or Reiszeit = 'Nein',Stunden,Stunden) ) as Stunden_Projekt
hope it helps
sum(if($(Menu) <> 1 or Reiszeit = 'Nein', Stunden))
Hi,
there is still a mistake:
Error in expression:
')' expected
Testfile:
LOAD MAID_Z,
left (MAID_Z, 14) as MAID_gesamt_Z,
sum(if( <> 1 or Reiszeit = 'Nein', Stunden)) as Stunden_Projekt
Resident table1
Group by MAID_Z
... and I would like to sum a) Stunden where Reisezeit = "Nein" and menu = 1
b) (else) sum all Stunden also where Reisezeit = "Ja" and "Nein"
=> my idea is to switch the filter of Reizeit "JA" / "Nein" with the variable menu
Hope it helps...
Thank you all for your assistance.
You forgot to set $(Menu) variable - it's blank in your example, if it possible(a blank) then try this:
sum(if('$(Menu)' <> '1' or Reiszeit = 'Nein', Stunden))
or just set $(Menu) to needed value.
Sorry, I still don't get it.
Why do you take "or"? The aim is to have a variable that switches the sum-function between all "Stunden" and the "Stunden" which have also Reisezeit = "Nein"
Example:
Nr. Reisezeit Stunden
1 Nein 5
2 Nein 5
3 Ja 5
4 Ja 5
if menu = 1 =>sum Stunden = 20
if menu = 0 => sum Stunden = 10
For setting menu 1 or 0 I have a slider in the design-part to switch.
Hope you can help me.
HI
Try like this
In expression:
= If(menu = 1, Sum(Stunden), Sum({<Reisezeit = {'Nein'}>}Stunden))
Hope it helps
Thank you,
but there is a mistake in the expression according to qv.