Skip to main content
Announcements
Qlik Acquires Upsolver to Advance Iceberg Solutions: READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

match

Hi,

I have variables as follows:

vCurrentYear=Year(Today())

vPreviousYear=Year(Today())-1

The script as:

LOADDistinct
    [Year Count] as [Year],
    [From Month],
    [From Month No],

FROM Calender_Dimension.qvd(qvd)

where Match(year([Calendar Date]),'$(vCurrentYear)','$(vPreviousYear)');

when i reload it is throwing error.

can any 1 tell y?

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Prudvi,

Check the below script,

vCurrentYear=Year(Today());

vPreviousYear=Year(Today())-1;

LOAD Distinct

    [Year Count] as [Year],

    [From Month],

    [From Month No]

FROM Calender_Dimension.qvd(qvd)

where Match(year([Calendar Date]),'$(vCurrentYear)','$(vPreviousYear)');

View solution in original post

17 Replies
mohamed_ahid
Partner - Specialist
Partner - Specialist

Hi

from where came [Calendar Date] used in match function ?

tresesco
MVP
MVP

What is the error message you get? Here, in your share script couple of errors are there. Missing semi colons after variable declaration; unwanted comma after last field in load...are they typo?

buzzy996
Master II
Master II

pls share ur error with app?

"Calendar Date" is there in ur Calender_Dimension.qvd(qvd)?

Not applicable
Author

from Calender_Dimension

Not applicable
Author

yes

Mark_Little
Luminary
Luminary

Hi,

First thing i would check your variables are being populated correctly.

Add a Trace after you populate them.

Trace $(vCurrentYear):

Trace $(vPreviousYear);

Mark

Anonymous
Not applicable
Author

Hi, try with this:

let vCurrentYear=Year(Today());
let vPreviousYear=Year(Today())-1;

LOADDistinct
    [Year Count] as [Year],
    [From Month],
    [From Month No],

FROM Calender_Dimension.qvd(qvd)

where Match([Year Count],'$(vCurrentYear)','$(vPreviousYear)');

Elena

buzzy996
Master II
Master II

can u share ur .qvw?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

LOADDistinct
    [Year Count] as [Year],
    [From Month],
    [From Month No],

FROM Calender_Dimension.qvd(qvd)

where year([Calendar Date]) >= Year(Today() - 1);

Hope this helps you.

Regards,

jagan.