Qlik Community

Qlik Sense Deployment & Management

Discussion board where members learn more about Qlik Sense Installation, Deployment and Management.

zied_ahmed1
Contributor III

Condition not working

Hello,

I have this condition and it works :

sum( {<[Month of date]= >}

if( Pays='Maroc',

aggr(

if (Only({<[Month of date]>}Code_Ligne)='MAR',

(

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'}, [Month of date]=,Flag_Doublon={1}>}Dossier)

/2

)

+

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'},[Month of date]=,Timeframe=,Flag_Doublon={0}>}Dossier)

,

Count({<$(vSetPeriodRange), [Month of date]=>}Dossier))

, Pays, [Month of date]),

aggr(Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)

,Pays, [Month of date])

)

)


But when i want to delete the condition if( Pays='Maroc',  it doesn't work :


sum( {<[Month of date]= >}

if (Only({<[Month of date]>}Code_Ligne)='MAR',

aggr(

(

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'}, [Month of date]=,Flag_Doublon={1}>}Dossier)

/2

)

+

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'},[Month of date]=,Timeframe=,Flag_Doublon={0}>}Dossier)

,

Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)

, Pays, [Month of date]),

aggr(Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)

,Pays, [Month of date])

)

)

Thank you

1 Solution

Accepted Solutions

Re: Condition not working

May be try this:

Sum({<[Month of date]=>}

Aggr(

If(Only({<[Month of date]>} Code_Ligne)='MAR',


(Count({<$(vSetPeriodRange),Code_Ligne={'MAR'}, [Month of date]=,Flag_Doublon={1}>}Dossier)/2) +

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'},[Month of date]=,Timeframe=,Flag_Doublon={0}>}Dossier),


Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)),


Pays, [Month of date]))

6 Replies

Re: Condition not working

If you are removing the if condition, then remove the true or false condition also... try this

sum( {<[Month of date]= >}

if (Only({<[Month of date]>}Code_Ligne)='MAR',

aggr(

(

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'}, [Month of date]=,Flag_Doublon={1}>}Dossier)

/2

)

+

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'},[Month of date]=,Timeframe=,Flag_Doublon={0}>}Dossier)

,

Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)

, Pays, [Month of date]),

aggr(Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)

,Pays, [Month of date])

)

)

zied_ahmed1
Contributor III

Re: Condition not working

the problem is not solved yet when i remove

,

Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)

Re: Condition not working

May be try this:

Sum({<[Month of date]=>}

Aggr(

If(Only({<[Month of date]>} Code_Ligne)='MAR',


(Count({<$(vSetPeriodRange),Code_Ligne={'MAR'}, [Month of date]=,Flag_Doublon={1}>}Dossier)/2) +

Count({<$(vSetPeriodRange),Code_Ligne={'MAR'},[Month of date]=,Timeframe=,Flag_Doublon={0}>}Dossier),


Count({<$(vSetPeriodRange), [Month of date]=>}Dossier)),


Pays, [Month of date]))

zied_ahmed1
Contributor III

Re: Condition not working

Oh great ,problem resolved

Thank you Sunny

Re: Condition not working

It worked?

zied_ahmed1
Contributor III

Re: Condition not working

Yes Sunny Thank you

Community Browser