Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

I want to select rows in a table based on checking a SQL table value against a QlikView variable

I want to select rows in a table based on checking a SQL table value against a QlikView variable.

Something like:

PRESENT_PERIOD:

LOAD *;

SQL SELECT

    CURRENT_FISCAL_YEAR,

FROM PRESENT_PERIOD;

LET vCURRENT_FISCAL_YEAR = '=CURRENT_FISCAL_YEAR';

BUDGET:

LOAD 

        BudgetAmount

FROM

[local_data\Who gets what report.xlsx]

(ooxml, embedded labels, table is Budget_rows)

where FY=$(vCURRENT_FISCAL_YEAR);

This doesn't work.

error excerpt

where FY==CURRENT_FISCAL_YEAR

2018-07-13 15:52:14          21 fields found: ACCOUNTING_PERIOD_GLD, <snip>

2018-07-13 15:52:14      294,669 lines fetched

2018-07-13 15:52:14      Error: Unexpected token: '==', expected nothing

Any suggestions?

1 Solution

Accepted Solutions
Champion III
Champion III

may be try this?

PRESENT_PERIOD:

LOAD *;

SQL SELECT

    CURRENT_FISCAL_YEAR,

FROM PRESENT_PERIOD;

LET vCURRENT_FISCAL_YEAR = Peek('CURRENT_FISCAL_YEAR',-1);

BUDGET:

LOAD

        BudgetAmount

FROM

[local_data\Who gets what report.xlsx]

(ooxml, embedded labels, table is Budget_rows)

where FY= '$(vCURRENT_FISCAL_YEAR)';

View solution in original post

1 Reply
Champion III
Champion III

may be try this?

PRESENT_PERIOD:

LOAD *;

SQL SELECT

    CURRENT_FISCAL_YEAR,

FROM PRESENT_PERIOD;

LET vCURRENT_FISCAL_YEAR = Peek('CURRENT_FISCAL_YEAR',-1);

BUDGET:

LOAD

        BudgetAmount

FROM

[local_data\Who gets what report.xlsx]

(ooxml, embedded labels, table is Budget_rows)

where FY= '$(vCURRENT_FISCAL_YEAR)';

View solution in original post