Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Monthly value

Hello everybody,

I am trying to do and P&L table showing:

- the values for the selected month if only one month is selected (=sum({$<Indicateur={"I3"} >} MONTANT)/1000)

- the monthly value of each month selected if several months are selected

- the YTD value (=sum({$<%Annee = {$(=only(%Annee))}, %NoMois = {"<=$(=max(%NoMois))"}, Indicateur={'I3'} >} MONTANT)/1000)

I know how to display the columns of the selected months but can't get to display the correct values. Everytime, the table shows the sum of all the months selected in each column.

Do you what expression I should type?

Thank you for your help,

Lorraine

Here are the expressions I tried:

=Sum({$<[%Nomois (#)] = {$(=Only([%NoMois (#)]))},  Indicateur={"I3"}>} MONTANT)

=Sum({$<[%Nomois (#)] = {$(=Only([%NoMois (#)]) – 1)},  Indicateur={"I3"}>} MONTANT)

=Sum({$<[Month (#)] = {$(=Max([Month (#)]) – 1)},  Indicateur={"I3"}>} MONTANT)

=sum({$< , Indicateur={"I3"}>} MONTANT)/1000

=sum({$<%Annee = {$(=only(%Annee))}, %NoMois = {$(=only(%NoMois))},  Indicateur={"I3"}>} MONTANT)

3 Replies
JonnyPoole
Former Employee
Former Employee

The answer will depend on your data model.. can you share your QVW or a sample ?

Not applicable
Author

Here is the time script:

//Let vYear  = Num(year(Today())) ;

set vToday = date(today(), 'DD/MM/YYYY');

LET vThisYear = year($(vToday)) ; //year(vToday);

LET vLastYear = year($(vToday)) - 1;

LET vThisQuarter = 'Q' & ceil(month($(vToday) / 3));

LET vThisMonth = num(month($(vToday)));

LET vThisMonthText = month($(vToday));

LET vLastMonth = num(month(addmonths($(vToday), -1)));

LET vLastMonthText = month(addmonths($(vToday), -1));

LET vTodayWithinYear = num($(vToday) - yearstart($(vToday))) + 1;

LET vTodayWithinMonth = num($(vToday) - monthstart($(vToday))) + 1;

Is this sample enough for you?

data model.PNG.png

JonnyPoole
Former Employee
Former Employee

Hi - just getting back to this.  Can you share the QVW (scramble the data if needed) and show me which expressions or charts aren't giving you the right numbers ?