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

Problem with count of records

Hi all,

I have a problem with rowno(), I have a connection with OLEDB, and I load a table with id, idValue and price, in a simple table I make the average of this prices, and all is correct, but my problem is that I need make the average of the last 200 records. I have seem that the function rowno(), to assign a autonumeric to each record, but when I use this function, It return the count of total table, and I need group by idValue.

Thanks in advance,

Irene.

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I modified your script for you.

Try this

About "circular references" i want to say to delete the table "$Syn 1 Table" (the system create this table when have a "circular references"). This is a problem for a consistence of your qvw document.

View solution in original post

16 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Can you please upload the script you are using.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Of course.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   From the script i think your data model may have a loop.

   Can you please upload the  qvw file with the o/p you want.

Regards,

Kaushik Solanki 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Yes, of course.

In this file you can see one operation that make the average for 200 day before, but I need make the average for 200 record before.

Thanks in advance.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

   I am not getting what you mean to say by average of 200 records before.

   Please describe your problem in detail with example.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Yes, I have a table with this data:

id      idValor      close      date

12         1          25           01/12/10

54         1          45           02/12/10

55         1          56           03/12/10

66         1          78           06/12/10

56         2          30           01/12/10

78         2          67           02/12/10

I need to know the average of close value, and I have the dates, but don't have records in the table for weekends and holidays, and I need make the average since the last date until 200 records befores,(NO DAYS), because only need do the avegar with working days and in the table I haven't no workings days.

group by with idValor.

I don't nkow if is more clear, sorry but my english is bad...   

Not applicable
Author

Hi,

First you need to eliminate the circular reference from tables: "valor_indice", "valores" and "cotizaciones_valor":

Ref_Circ.png

valor_indice:

LOAD

     IdValor & '#' & Id AS key_cotizaciones_valor,

     IdIndice,

FROM your_table_A;

cotizaciones_valor:

LOAD

     IdValor & '#' & Id AS keyCotizacionesValor,

     IdValor AS keyValores

     cierre,

     Fecha,

     volumen

FROM your_table_B;

valores:

LOAD

     IdValor AS keyValores,

     descripcionValor,

     simboloValor

FROM your_table_C;

You can do a joins with this tables and input the function ROWNO() to returno the number of register.

See attachment.

Not applicable
Author

Hi Eduardo,

Thanks for your answer, but still don't work, the problem now, is when I launch the script, when this arrive to cotizaciones_valor the qlickviw down, and I can't do nothing.

I have attached the script, only I have changed the LOAD by SELECT.

But I don't understand well, what you want say with "delete circular references", and why drop table "mercados".

Sorry, But I'm new with qlickview 😞

Thanks for all, Irene.

Not applicable
Author

Hi,

I modified your script for you.

Try this

About "circular references" i want to say to delete the table "$Syn 1 Table" (the system create this table when have a "circular references"). This is a problem for a consistence of your qvw document.