Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

amit_saini
Honored Contributor III

Call only top1 row from DB help???

Hi Folks,

I'm having below scenario:

I need to calculate sum of Quantity , in text box -O/P is 63 which is wrong , looks to me we are having some extra values added here , but not sure from where they came.

But table is showing me correct sum which is 36.

Issue is until left join of Global_Station table even text box is showing right "36" as O/P , but when I'm calling "Sub_Station" table for LineSection info this o/p becomes 63, looks like some additional values are coming from this table.

Might be if I read only 1 row of Sub_Station table then this issue might fix , but not sure how to do this.

Or

There might be some other issue , which I'm not able to think.

Any suggestions?

Thanks in advance!

Regards,

AS

5 Replies
MVP
MVP

Re: Call only top1 row from DB help???

I think your join is causing double counting of some values. Rather than joining the table, load it the same way without the Left join statement and let QV association take care of the relationship. Then the value should be correct

karthikoffi27se
Contributor III

Re: Call only top1 row from DB help???

Hi Amit,

If you just need load line section field why don't try mapping load.

Many Thanks

Kathik

amit_saini
Honored Contributor III

Re: Call only top1 row from DB help???

Hi Karthik,

I have tried that too , but same result.

regards,

AS

amit_saini
Honored Contributor III

Re: Call only top1 row from DB help???

Hi Jonathan,

If I'm calling alone Interruption table your suggestion is working fine , but I need to concatenate this table in last with CAQ and in CAQ table also I'm calling same Sub_Station table.

Concatenate(CAQ)

Load * Resident Interruption;

Drop Table Interruption;

Calling without join is creating sync keys and on layout side filters for LineSection is not working fine.

Any suggestion?

Regards,

Amit

MVP
MVP

Re: Call only top1 row from DB help???

Not really - your problem is wider than the two tables described in your post. This really a case of some thought into the overall design. And why do you have a Sub_Station1 table?

Community Browser