Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

neapicture
New Contributor III

GetFieldSelections-Function - calculate the previous month

Hey Guys,

I have a problem with the GetFieldSelections-Function. I would like the Month before the Selection (previous month)

That is my expression:

=Sum({<Monat={"$(=GetFieldSelections(Monat)-1)"}>}Plan)

The calculation of the currently selected month works

Could you help me?

Thank you very much!

6 Replies
MVP
MVP

Re: GetFieldSelections-Function - calculate the previous month

Are you selecting a single month value? How did you create month field in the script, using month()?

neapicture
New Contributor III

Re: GetFieldSelections-Function - calculate the previous month

Yes, a single month is always chosen.

Only there does the calculation need to work

... and i use Month()

Month(Datumsfeld) AS Monat,

SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';

---

MVP
MVP

Re: GetFieldSelections-Function - calculate the previous month

Try formatting the dual to string for set comparison like:

=Sum({<Monat={"$(=Month(Date#(GetFieldSelections(Monat)-1,'M')))"}>}Plan)

MVP
MVP

Re: GetFieldSelections-Function - calculate the previous month

Try formatting the dual to string for set comparison like:

=Sum({<Monat={"$(=Month(Date#(GetFieldSelections(Monat)-1,'M')))"}>}Plan)

neapicture
New Contributor III

Re: GetFieldSelections-Function - calculate the previous month

...the part of the formula "-1" does not work for me. I think there is the problem. But I have no solution

=Sum({<Monat={"$(=Month(Date#(GetFieldSelections(Monat)-1,'MMM')))"}>}Plan)

MVP
MVP

Re: GetFieldSelections-Function - calculate the previous month

Could you post a sample qvw?

Community Browser